package Thread;

import java.awt.*;
//工厂模式，将构造方法优化为用类的静态方法创建，在静态方法内部创建
class PointFactory{
    public static Point createPoint(int x, int y){
        return new Point(x, y);
    }
    public static Point createPoint2(int x, int y){
        return new Point();
    }
}
public class Demo33 {
    public static void main(String[] args) {
    Point point = PointFactory.createPoint(5, 10);
    }
}
